<?php
namespace app\admin\model;

use think\Model;

class Tour extends Model
{
    public function getImageAttr($value)
    {
        return empty($value) ? '': fixed_url() . 'upload/' . $value;
    }

    protected $table='tour';

    public function index(){
        return 0;
    }
    public function addEmp($data)
    {
        $this->save($data);
    }

    public function getList($name)
    {
        return $this->select();
//        session('food_id', $name);
//        return $this->where('food_id', $name)->select();
    }

    public function getTours($no){
        return $this->where('tour_id',$no)->find();
    }
    public function getHead($name,$head){
        return $this->where('tour_id',$name)->update(['tour_picture' => $head]);
    }
    public function updateTours($data){
        return $this->isUpdate(true)->save($data);
    }

    public function delTours($no){
        return $this->where('tour_id',$no)->delete();
    }

}
